<?php

use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$logger = new Logger(getenv('LOGGER_NAME'));

$logger->pushHandler(new StreamHandler(getenv('LOGGER_PATH'), Logger::DEBUG));

$logger->pushProcessor(function ($record) {
    $record['extra']['dummy'] = 'Hello world!';

    return $record;
});

// 开始使用
$logger->addInfo('My logger is now ready');
